import type { RouteRecordRaw } from "vue-router";
import { allComponent } from "../routes";

/**
 * defaultRouter(默认路由)
 */
export const defaultRouter: RouteRecordRaw[] = [
  {
    path: "/",
    name: "home",
    meta: {
      title: "管理页面",
      open: false,
      hidden: false,
      target: "_self",
      isLeaf: true,
      icon: "",
    },
    redirect: { name: "WelPage" },
    component: allComponent.get("LayoutView"),
    children: [
      {
        path: "/wel",
        name: "WelPage",
        meta: {
          title: "欢迎",
          open: false,
          hidden: false,
          target: "_self",
          isLeaf: true,
          icon: "",
        },
        component: allComponent.get("WelPage"),
      },
      {
        path: "/personal",
        name: "PersonalPage",
        meta: {
          title: "个人中心",
          open: false,
          hidden: false,
          target: "_self",
          isLeaf: true,
          icon: "",
        },
        component: allComponent.get("PersonalPage"),
      },
      {
        path: "/setting",
        name: "SettingPage",
        meta: {
          title: "个人设置",
          open: false,
          hidden: false,
          target: "_self",
          isLeaf: true,
          icon: "",
        },
        component: allComponent.get("SettingPage"),
      },
      {
        path: "/tinymce",
        name: "TinymcePage",
        meta: {
          title: "富文本",
          open: false,
          hidden: false,
          target: "_self",
          isLeaf: true,
          icon: "",
        },
        component: allComponent.get("TinymcePage"),
      },
      {
        path: "/table",
        name: "TablePage",
        meta: {
          title: "高级表格",
          open: false,
          hidden: false,
          target: "_self",
          isLeaf: true,
          icon: "",
        },
        component: allComponent.get("TablePage"),
      },
    ],
  },
  {
    path: "/account",
    name: "account",
    meta: {
      title: "账户",
      open: true,
      hidden: false,
      target: "_self",
      isLeaf: true,
      icon: "",
    },
    component: allComponent.get("AccountRouter"),
    redirect: { name: "LoginPage" },
    children: [
      {
        path: "/account/login",
        name: "LoginPage",
        meta: {
          title: "登录页",
          open: true,
          hidden: false,
          target: "_self",
          isLeaf: true,
          icon: "",
        },
        component: allComponent.get("LoginPage"),
      },
      {
        path: "/account/register",
        name: "RegisterPage",
        meta: {
          title: "注册页",
          open: true,
          hidden: false,
          target: "_self",
          isLeaf: true,
          icon: "",
        },
        component: allComponent.get("RegisterPage"),
      },
      {
        path: "/account/forget",
        name: "ForgetPage",
        meta: {
          title: "忘记密码",
          open: true,
          hidden: false,
          target: "_self",
          isLeaf: true,
          icon: "",
        },
        component: allComponent.get("ForgetPage"),
      },
      {
        path: "/account/lock",
        name: "LockPage",
        meta: {
          title: "锁定",
          open: true,
          hidden: false,
          target: "_self",
          isLeaf: true,
          icon: "",
        },
        component: allComponent.get("LockPage"),
      },
      {
        path: "/account/redirect",
        name: "RedirectPage",
        meta: {
          title: "回调页",
          open: true,
          hidden: false,
          target: "_self",
          isLeaf: true,
          icon: "",
        },
        component: allComponent.get("RedirectPage"),
      },
    ],
  },
];
